﻿using System;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using System.Collections.Generic;

using xEngine.Rendering;

namespace xEngine
{
    public class GenericResources
    {
        #region Singleton

        private static GenericResources inst = new GenericResources();
        private GenericResources()
        {
        }

        #endregion

        #region Properties

        public static bool IsInitialized { get; private set; }

        public static Texture2D BlankTexture { get; private set; }
        public static GenericFonts Fonts { get; private set; }
        public static GenericColors Colors { get; private set; }

        #endregion

        #region Functions

        public static void Initialize(GraphicsDevice device)
        {
            BlankTexture = new Texture2D(device, 1, 1);
            BlankTexture.SetData<Color>(new Color[] { Color.White });

            Fonts = new GenericFonts();
            Colors = new GenericColors();

            IsInitialized = true;
        }

        #endregion
    }

    public class GenericColors
    {
        #region Constructors

        public GenericColors()
        {
            LightBlue = new Color(0, 130, 189, 255);
            xEngineRed = new Color(199, 0, 0, 255);
        }

        #endregion

        #region Properties

        public Color LightBlue { get; private set; }
        public Color xEngineRed { get; private set; }

        #endregion
    }

    public class GenericFonts
    {
        #region Constructors

        public GenericFonts()
        {
            Generic08 = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic08");
            Generic10 = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic10");
            Generic12 = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic12");
            Generic14 = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic14");
            Generic18 = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic18");

            Generic08N = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic08n");
            Generic10N = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic10n");
            Generic12N = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic12n");
            Generic14N = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic14n");
            Generic18N = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic18n");

            Generic08B = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic08b");
            Generic10B = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic10b");
            Generic12B = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic12b");
            Generic14B = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic14b");
            Generic18B = RenderManager.EmbeddedContent.Load<SpriteFont>("f_generic18b");

            Fixed08 = RenderManager.EmbeddedContent.Load<SpriteFont>("f_fixed08");
            Fixed10 = RenderManager.EmbeddedContent.Load<SpriteFont>("f_fixed10");
            Fixed12 = RenderManager.EmbeddedContent.Load<SpriteFont>("f_fixed12");
            Fixed14 = RenderManager.EmbeddedContent.Load<SpriteFont>("f_fixed14");
            Fixed16 = RenderManager.EmbeddedContent.Load<SpriteFont>("f_fixed16");
            Fixed18 = RenderManager.EmbeddedContent.Load<SpriteFont>("f_fixed18");
        }

        #endregion

        #region Properties

        public SpriteFont Generic08 { get; private set; }
        public SpriteFont Generic10 { get; private set; }
        public SpriteFont Generic12 { get; private set; }
        public SpriteFont Generic14 { get; private set; }
        public SpriteFont Generic18 { get; private set; }
        public SpriteFont Generic08N { get; private set; }
        public SpriteFont Generic10N { get; private set; }
        public SpriteFont Generic12N { get; private set; }
        public SpriteFont Generic14N { get; private set; }
        public SpriteFont Generic18N { get; private set; }
        public SpriteFont Generic08B { get; private set; }
        public SpriteFont Generic10B { get; private set; }
        public SpriteFont Generic12B { get; private set; }
        public SpriteFont Generic14B { get; private set; }
        public SpriteFont Generic18B { get; private set; }

        public SpriteFont Fixed08 { get; private set; }
        public SpriteFont Fixed10 { get; private set; }
        public SpriteFont Fixed12 { get; private set; }
        public SpriteFont Fixed14 { get; private set; }
        public SpriteFont Fixed16 { get; private set; }
        public SpriteFont Fixed18 { get; private set; }

        #endregion
    }
}
